package com.botu.springcloudsentineldatasource.controller;

import com.botu.springcloudsentineldatasource.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: hanzeyao
 * @Date: 2019/12/12 09:21
 * @Description:
 */
@RestController
public class TestController {

    @Autowired
    private TestService testService;
    @GetMapping("/{str}")
    public String test(@PathVariable String str){
        return str;
    }

    @GetMapping("/hello")
    public String hello() {
        return "hello sentinel";
    }

    @GetMapping("demo")
    public String demo(){
        return testService.demo();
    }

    @GetMapping("/sentinel")
    public String demo2(){
        return testService.demo2();
    }

    @GetMapping("/degrade")
    public String degrade(){
        return testService.degrade();
    }

}
